<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>read_image [HALCON算子参考手册]</title>
<style type="text/css">
      body {
    color: #000000;
    background-color: #ffffff;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.body_main {
    margin-left: 35px;
    margin-right: 35px;
}

@media screen and (min-width:992px) {

    .body_main {
        margin-left: 10%;
        margin-right: 10%;
    }

    table.toctable {
        width: 80%
    }
}

@media screen and (min-width:1400px) {

    .body_main {
        margin-left: 15%;
        margin-right: 15%;
    }

    table.toctable {
        width: 70%
    }
}

body>div ul ul {
    margin-left: inherit;
}

a:link {
    color: #0044cc;
}

a:link,
a:visited {
    text-decoration: none;
}

a:link:hover,
a:visited:hover {
    text-decoration: underline;
}

th {
    text-align: left;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-rendering: optimizeLegibility;
    color: #666666;
}

code {
    font-family: monospace,monospace;
}

h1 a.halconoperator {
    font-family: Arial, Helvetica, sans-serif;
    color: #666666;
}

h2 a.halconoperator {
    font-family: Arial, Helvetica, sans-serif;
    color: #666666;
}

hr {
    border: 0;
    border-top: solid 1px #f28d26;
}

.pre {
    display: block;
    padding-bottom: 1ex;
    font-family: monospace;
    white-space: pre;
}

pre {
    font-family: monospace, monospace;
    padding: 1ex;
    white-space: pre-wrap;
}

.toc {
    font-size: 80%;
    border-top: 1px dashed #f28d26;
    border-bottom: 1px dashed #f28d26;
    padding-top: 5px;
    padding-bottom: 5px;
}

.inv {
    margin: 0;
    border: 0;
    padding: 0;
}

.banner {
    color: #666666;
    padding-left: 1em;
}

.logo {
    background-color: white;
}

.keyboard {
    font-size: 80%;
    padding-left: 3px;
    padding-right: 3px;
    border-radius: 5px;
    border-width: 1px;
    border-style: solid;
    border-color: #f28d26;
    background-color: #f3f3f3;
}

.warning {
    margin-top: 2ex;
    margin-bottom: 1ex;
    padding: 10px;
    text-align: center;
    border: 1px solid;
    color: #bb0000;
    background-color: #fff7f7
}

.imprint {
    margin-top: 1ex;
    font-size: 80%;
    color: #666666;
}

.imprinthead {
    font-weight: bolder;
    color: #666666;
}

.indexlink {
    text-align: right;
    padding-bottom: 5px;
}

.postscript {
    margin-top: 2ex;
    font-size: 80%;
    color: #666666
}

.evenrow {
    background-color: #e7e7ef;
    vertical-align: top;
}

.oddrow {
    background-color: #f7f7ff;
    vertical-align: top;
}

.headrow {
    background-color: #97979f;
    color: #ffffff;
    vertical-align: top;
}

.logorow {
    vertical-align: top;
}

.error {
    color: red;
}

.var {
    font-style: italic
}

.halconoperator {
    font-family: monospace, monospace;
}

span.operator {
    font-family: monospace, monospace;
}

span.procedure {
    font-family: monospace, monospace;
}

span.operation {
    font-family: monospace, monospace;
}

span.feature {
    font-family: Arial, Helvetica, Homerton, sans-serif;
}

ul {
    padding-left: 1.2em;
}

li.dot {
    list-style-type: square;
    color: #f28d26;
}

.breadcrumb {
    font-size: 80%;
    color: white;
    background-color: #062d64;
    margin-bottom: 20px;
    padding-left: 35px;
    padding-right: 35px;
    padding-bottom: 15px;
}

.webbar {
    font-size: 80%;
    background-color: #dddddd;
    margin-top: 0px;
    margin-left: -35px;
    margin-right: -35px;
    margin-bottom: 0px;
    padding-top: 5px;
    padding-left: 35px;
    padding-right: 35px;
    padding-bottom: 5px;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    border-top: 1px dashed #f28d26;
    font-size: 80%;
    color: #666666;
    padding-bottom: 8px;
}

.footer .socialmedia a {
    padding-left: 7px;
}

.socialmedia {
    padding-top: 10px;
}

.copyright {
    margin-top: 19px;
}

.breadcrumb a {
    color: #ffffff;
    border-bottom: 1px solid white;
}

.breadcrumb a:link:hover,
.breadcrumb a:visited:hover {
    text-decoration: none;
    border-bottom: none;
}

.heading {
    margin-top: 1ex;
    font-size: 110%;
    font-weight: bold;
    color: #666666;
}

.text {
    color: black;
}

.example {
    font-size: 80%;
    background-color: #f3f3f3;
    border: 1px dashed #666666;
    padding: 10px;
}

.displaymath {
    display: block;
    text-align: center;
    margin-top: 1ex;
    margin-bottom: 1ex;
}

.title {
    float: left;
    padding-top: 3px;
    padding-bottom: 3px;
}

.signnote {
    font-family: Arial, Helvetica, Homerton, sans-serif;
    font-size: 80%;
    color: #666666;
    font-weight: lighter;
    font-style: italic
}

.par {
    margin-bottom: 1.5em;
}

.parhead {
    text-align: right;
}

.parname {
    float: left;
}

.pardesc {
    font-size: 85%;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: 2em;
}

.parcat {
    color: #666;
    font-weight: bold;
}

*[data-if=cpp],
*[data-if=c],
*[data-if=dotnet],
*[data-if=com],
*[data-if=python] {
    display: none;
}

.tabbar {
    text-align: right;
    border-bottom: 1px solid #f28d26;
    margin-bottom: 0.5em;
}

ul.tabs {
    padding-top: 3px;
    padding-bottom: 3px;
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 80%
}

ul.tabs li {
    padding-top: 3px;
    padding-bottom: 3px;
    display: inline;
    overflow: hidden;
    list-style-type: none;
    margin: 0;
    margin-left: 8px;
    border-top: 1px solid #666;
    border-left: 1px solid #666;
    border-right: 1px solid #666;
}

ul.tabs li.active {
    border-left: 1px solid #f28d26;
    border-right: 1px solid #f28d26;
    border-top: 1px solid #f28d26;
    border-bottom: 1px solid #fff;
}

ul.tabs li.inactive {
    background-color: #eee;
}

ul.tabs li a {
    padding-left: 5px;
    padding-right: 5px;
    color: #666;
}

ul.tabs li a:link:hover {
    text-decoration: none;
}

ul.tabs li.inactive a {
    color: #666;
}

ul.tabs li.active a {
    color: black;
}

dl.generic dd {
    margin-bottom: 1em;
}

.pari {
    color: olive;
}

.paro {
    color: maroon;
}

.comment {
    font-size: 80%;
    color: green;
    white-space: nowrap;
}

table.grid {
    border-collapse: collapse;
}

table.grid td {
    padding: 5px;
    border: 1px solid;
}

table.layout {
    border: 0px;
}

table.layout td {
    padding: 5px;
}

table.table {
    border-collapse: collapse;
}

table.table td {
    padding: 5px;
    border-left: 0px;
    border-right: 0px;
}

table.table tr:last-child {
    border-bottom: 1px solid;
}

table.table th {
    padding: 5px;
    border-top: 1px solid;
    border-bottom: 1px solid;
    border-left: 0px;
    border-right: 0px;
}

.details_summary {
    cursor: pointer;
}

table.toctable {
    width: 100%;
}

table.toctable col:first-child {
    width: 20%;
}

table.toctable col:nth-last-child(2) {
    width: 8%;
}

table.altcolored tr:nth-child(even) {
    background-color: #f3f3f3;
}

    </style>
<!--OP_REF_STYLE_END-->
<script>
    <!--
var active_lang='hdevelop';function switchVisibility(obj,active_lang,new_lang)
{var display_style='inline';
for(var i=0;i<obj.length;i++)
{if(obj.item(i).getAttribute('data-if')==new_lang)
{obj.item(i).style.display=display_style;}
if(obj.item(i).getAttribute('data-if')==active_lang)
{obj.item(i).style.display='none';}}
return;}
function toggleLanguage(new_lang,initial)
{if(active_lang!=new_lang)
{var lis=document.getElementsByTagName('li');for(var i=0;i<lis.length;i++)
{if(lis.item(i).id=='syn-'+new_lang)
{lis.item(i).className='active';}
else
{lis.item(i).className='inactive';}}
var divs=document.getElementsByTagName('div');var spans=document.getElementsByTagName('span');switchVisibility(divs,active_lang,new_lang);switchVisibility(spans,active_lang,new_lang);if(!initial)
{setCookie("halcon_reference_language",new_lang,null,null);}
active_lang=new_lang;}
return;}
function setCookie(name,value,domain,exp_offset,path,secure)
{localStorage.setItem(name,value);}
function getCookie(name)
{return localStorage.getItem(name);}
function initialize()
{var qs=location.href.split('?')[1];var qs_lang_raw=location.href.split('interface=')[1];var qs_lang;if(qs_lang_raw)
{qs_lang=qs_lang_raw.split('#')[0];}
var cookie_lang=getCookie("halcon_reference_language");var new_lang;if((qs_lang=="hdevelop")||(qs_lang=="dotnet")||(qs_lang=="python")||(qs_lang=="cpp")||(qs_lang=="c"))
{new_lang=qs_lang;setCookie("halcon_reference_language",new_lang,null,null);}
else if((cookie_lang=="hdevelop")||(cookie_lang=="dotnet")||(cookie_lang=="python")||(cookie_lang=="cpp")||(cookie_lang=="c"))
{new_lang=cookie_lang;}
else
{new_lang="hdevelop";}
toggleLanguage(new_lang,1);return;}
-->

  </script>
</head>
<body onload="initialize();">
<div class="breadcrumb">
<br class="inv"><a href="index.html">目录</a> / <a href="toc_file.html">File</a> / <a href="toc_file_images.html">Images</a><br class="inv">
</div>
<div class="body_main">
<div class="tabbar"><ul class="tabs">
<li id="syn-hdevelop" class="active"><a href="javascript:void(0);" onclick="toggleLanguage('hdevelop')" onfocus="blur()">HDevelop</a></li>
<li id="syn-dotnet" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('dotnet')" onfocus="blur()">.NET</a></li>
<li id="syn-python" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('python')" onfocus="blur()">Python</a></li>
<li id="syn-cpp" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('cpp')" onfocus="blur()">C++</a></li>
<li id="syn-c" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('c')" onfocus="blur()">C</a></li>
</ul></div>
<div class="indexlink">
<a href="index_classes.html"><span data-if="dotnet" style="display:none;">类别</span><span data-if="cpp" style="display:none;">类别</span></a><span data-if="dotnet" style="display:none;"> | </span><span data-if="cpp" style="display:none;"> | </span><a href="index_by_name.html">算子列表</a>
</div>
<!--OP_REF_HEADER_END-->
<h1 id="sec_name">
<span data-if="hdevelop" style="display:inline;">read_image</span><span data-if="c" style="display:none;">read_image</span><span data-if="cpp" style="display:none;">ReadImage</span><span data-if="dotnet" style="display:none;">ReadImage</span><span data-if="python" style="display:none;">read_image</span> (算子名称)</h1>
<h2>名称</h2>
<p><code><span data-if="hdevelop" style="display:inline;">read_image</span><span data-if="c" style="display:none;">read_image</span><span data-if="cpp" style="display:none;">ReadImage</span><span data-if="dotnet" style="display:none;">ReadImage</span><span data-if="python" style="display:none;">read_image</span></code> — 读取任意文件格式的图像。</p>
<h2 id="sec_synopsis">参数签名</h2>
<div data-if="hdevelop" style="display:inline;">
<p>
<code><b>read_image</b>( : <a href="#Image"><i>Image</i></a> : <a href="#FileName"><i>FileName</i></a> : )</code></p>
</div>
<div data-if="c" style="display:none;">
<p>
<code>Herror <b>read_image</b>(Hobject* <a href="#Image"><i>Image</i></a>, const char* <a href="#FileName"><i>FileName</i></a>)</code></p>
<p>
<code>Herror <b>T_read_image</b>(Hobject* <a href="#Image"><i>Image</i></a>, const Htuple <a href="#FileName"><i>FileName</i></a>)</code></p>
</div>
<div data-if="cpp" style="display:none;">
<p>
<code>void <b>ReadImage</b>(HObject* <a href="#Image"><i>Image</i></a>, const HTuple&amp; <a href="#FileName"><i>FileName</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>HImage</b>(const HTuple&amp; <a href="#FileName"><i>FileName</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>HImage</b>(const HString&amp; <a href="#FileName"><i>FileName</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>HImage</b>(const char* <a href="#FileName"><i>FileName</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>HImage</b>(const wchar_t* <a href="#FileName"><i>FileName</i></a>)  <span class="signnote">
            (
            Windows only)
          </span></code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>ReadImage</b>(const HTuple&amp; <a href="#FileName"><i>FileName</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>ReadImage</b>(const HString&amp; <a href="#FileName"><i>FileName</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>ReadImage</b>(const char* <a href="#FileName"><i>FileName</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>ReadImage</b>(const wchar_t* <a href="#FileName"><i>FileName</i></a>)  <span class="signnote">
            (
            Windows only)
          </span></code></p>
</div>
<div data-if="com" style="display:none;"></div>
<div data-if="dotnet" style="display:none;">
<p>
<code>static void <a href="HOperatorSet.html">HOperatorSet</a>.<b>ReadImage</b>(out <a href="HObject.html">HObject</a> <a href="#Image"><i>image</i></a>, <a href="HTuple.html">HTuple</a> <a href="#FileName"><i>fileName</i></a>)</code></p>
<p>
<code>public <a href="HImage.html">HImage</a>(<a href="HTuple.html">HTuple</a> <a href="#FileName"><i>fileName</i></a>)</code></p>
<p>
<code>public <a href="HImage.html">HImage</a>(string <a href="#FileName"><i>fileName</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>.<b>ReadImage</b>(<a href="HTuple.html">HTuple</a> <a href="#FileName"><i>fileName</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>.<b>ReadImage</b>(string <a href="#FileName"><i>fileName</i></a>)</code></p>
</div>
<div data-if="python" style="display:none;">
<p>
<code>def <b>read_image</b>(<a href="#FileName"><i>file_name</i></a>: MaybeSequence[str]) -&gt; HObject</code></p>
</div>
<h2 id="sec_description">描述</h2>
<p>该算子 <code><span data-if="hdevelop" style="display:inline">read_image</span><span data-if="c" style="display:none">read_image</span><span data-if="cpp" style="display:none">ReadImage</span><span data-if="com" style="display:none">ReadImage</span><span data-if="dotnet" style="display:none">ReadImage</span><span data-if="python" style="display:none">read_image</span></code> reads the indicated image files from
the background storage and generates the image.  One or more file
names can be passed in <a href="#FileName"><i><code><span data-if="hdevelop" style="display:inline">FileName</span><span data-if="c" style="display:none">FileName</span><span data-if="cpp" style="display:none">FileName</span><span data-if="com" style="display:none">FileName</span><span data-if="dotnet" style="display:none">fileName</span><span data-if="python" style="display:none">file_name</span></code></i></a>.  If more than one file
name is passed, an image object tuple with the corresponding number
of image objects is returned.
</p>
<h3>HALCON formats (HOBJ and IMA)</h3>
<p>For images in the HALCON Iconic Object format (HOBJ), multiple images
saved in one file are returned as a tuple of images. If regions or XLDs
are contained within the file, an exception is raised. See
<a href="write_object.html"><code><span data-if="hdevelop" style="display:inline">write_object</span><span data-if="c" style="display:none">write_object</span><span data-if="cpp" style="display:none">WriteObject</span><span data-if="com" style="display:none">WriteObject</span><span data-if="dotnet" style="display:none">WriteObject</span><span data-if="python" style="display:none">write_object</span></code></a> for more information about the HOBJ format.
</p>
<p>All images files written by 该算子 <a href="write_image.html"><code><span data-if="hdevelop" style="display:inline">write_image</span><span data-if="c" style="display:none">write_image</span><span data-if="cpp" style="display:none">WriteImage</span><span data-if="com" style="display:none">WriteImage</span><span data-if="dotnet" style="display:none">WriteImage</span><span data-if="python" style="display:none">write_image</span></code></a> (format
'ima') have the extension <code>'.ima'</code>.  A description file can
be available for every image in IMA format (same file name with
extension <code>'.exp'</code>).  The type of the pixel data
(<code>byte</code>, <code>int4</code>, <code>real</code>) can also be taken from
the description file. If the description file is not available, the
type <code>byte</code> is used by default as well as a default data
size (<code>'height'</code> x <code>'width'</code>) that can
be queried via <a href="get_system.html"><code><span data-if="hdevelop" style="display:inline">get_system</span><span data-if="c" style="display:none">get_system</span><span data-if="cpp" style="display:none">GetSystem</span><span data-if="com" style="display:none">GetSystem</span><span data-if="dotnet" style="display:none">GetSystem</span><span data-if="python" style="display:none">get_system</span></code></a>. If the data size of the
<code>'.ima'</code> file and the default data size are not equal, an
exception is raised.
</p>
<h3>Other formats</h3>
<p>Besides the HALCON formats, TIFF, GIF, BMP, JPEG, JPEG-2000, JPEG-XR, PNG,
PCX, SUN-Raster, PGM, PPM, PBM, and XWD files can also be read.  The
gray values of PBM images are set at the values 0 and 255.  The file
formats are either recognized by the extension (if indicated) or
because of the internal structure of the files.  If the extension is
indicated the image can be found faster. If no extension is
indicated, files with an extension are preferred to files without
extension.  In case of PGM, PPM, and PBM the corresponding extension
(e.g., <code>'pgm'</code>) or the general value <code>'pnm'</code> can be
used.  In case of TIFF <code>'tiff'</code> and <code>'tif'</code> are
accepted.  In case of JPEG-XR <code>'jxr'</code>, <code>'wdp'</code>, <code>'wmp'</code>,
and <code>'hdp'</code> are accepted.
In case of JPEG-2000 only <code>'jp2'</code> is accepted. In case
of colored images an image with three color channels is
created, the red channel being stored in the first, the green channel
in the second and the blue channel in the third component (channel
number).
</p>
<p>For the image formats TIFF, PNG, JPEG-XR, and JPEG-2000, binary alpha
channels are interpreted as domains.  For TIFF files, additionally
binary SubIFDs with PhotometricInterpretation = TransparencyMask
are interpreted as domains.  Otherwise, the domain of the generated
image object (= all pixels of the matrix) is chosen maximal.
</p>
<p>For TIFF images, multipage TIFF files are returned as image object
tuples. SubIFDs in a TIFF file are only read if their dimensions
are equal to the dimensions of the main image.
</p>
<p>Images of type 'int8' can be read on 64 bit systems only. Furthermore,
only the IMA and the TIFF format support this image type.
</p>
<p>Image files are searched in the current directory and in the image
directory of HALCON (determined by the environment variable).  The
image directory of HALCON is preset at <code>'.'</code> and
<code>'/usr/local/halcon/images'</code> in a Unix-like environment and can be
set via 该算子 <a href="set_system.html"><code><span data-if="hdevelop" style="display:inline">set_system</span><span data-if="c" style="display:none">set_system</span><span data-if="cpp" style="display:none">SetSystem</span><span data-if="com" style="display:none">SetSystem</span><span data-if="dotnet" style="display:none">SetSystem</span><span data-if="python" style="display:none">set_system</span></code></a>.  More than one image
directory can be indicated.  This is done by separating the
individual directories by a colon.
</p>
<p>Furthermore, the search path can be set via the environment variable
HALCONIMAGES (same structure as <code>'image_dir'</code>).  Example:
</p>
<p><span class="pre">
     setenv HALCONIMAGES "/usr/images:/usr/local/halcon/images"
</span>
</p>
<p>HALCON also searches images in the subdirectory
<code>'images'</code> (Images for the program examples).  The
environment variable HALCONROOT is used for the HALCON directory.</p>
<h2 id="sec_attention">注意</h2>
<p>If CMYK or YCCK JPEG/JPEG-XR files are read, HALCON assumes that these
files follow the Adobe Photoshop convention that the CMYK channels
are stored inverted, i.e., 0 represents 100% ink coverage, rather
than 0% ink as one would expect.  The images are converted to RGB
images using this convention.  If the JPEG file does not follow this
convention, but stores the CMYK channels in the usual fashion,
<a href="invert_image.html"><code><span data-if="hdevelop" style="display:inline">invert_image</span><span data-if="c" style="display:none">invert_image</span><span data-if="cpp" style="display:none">InvertImage</span><span data-if="com" style="display:none">InvertImage</span><span data-if="dotnet" style="display:none">InvertImage</span><span data-if="python" style="display:none">invert_image</span></code></a> must be called after reading the image.
</p>
<p>If PNG images that contain an alpha channel are read, the alpha
channel is returned as the second or fourth channel of the output
image, unless the alpha channel contains exactly two different gray
values, in which case a one or three channel image with a reduced
domain is returned, in which the points in the domain correspond to
the points with the higher gray value in the alpha channel.</p>
<h2 id="sec_execution">运行信息</h2>
<ul>
  <li>多线程类型:可重入(与非独占操作符并行运行)。</li>
<li>多线程作用域:全局(可以从任何线程调用)。</li>
  <li>未经并行化处理。</li>
</ul>
<h2 id="sec_parameters">参数表</h2>
  <div class="par">
<div class="parhead">
<span id="Image" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Image</span><span data-if="c" style="display:none">Image</span><span data-if="cpp" style="display:none">Image</span><span data-if="com" style="display:none">Image</span><span data-if="dotnet" style="display:none">image</span><span data-if="python" style="display:none">image</span></code></b> (output_object)  </span><span>image(-array) <code>→</code> <span data-if="hdevelop" style="display:inline">object</span><span data-if="dotnet" style="display:none"><a href="HImage.html">HImage</a></span><span data-if="python" style="display:none">HObject</span><span data-if="cpp" style="display:none"><a href="HImage.html">HImage</a></span><span data-if="c" style="display:none">Hobject *</span> (byte / direction / cyclic / int1 / complex / int2 / uint2 / vector_field / int4 / int8 / real)</span>
</div>
<p class="pardesc">Read image.</p>
</div>
  <div class="par">
<div class="parhead">
<span id="FileName" class="parname"><b><code><span data-if="hdevelop" style="display:inline">FileName</span><span data-if="c" style="display:none">FileName</span><span data-if="cpp" style="display:none">FileName</span><span data-if="com" style="display:none">FileName</span><span data-if="dotnet" style="display:none">fileName</span><span data-if="python" style="display:none">file_name</span></code></b> (input_control)  </span><span>filename.read(-array) <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">MaybeSequence[str]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (string)</span><span data-if="dotnet" style="display:none"> (<i>string</i>)</span><span data-if="cpp" style="display:none"> (<i>HString</i>)</span><span data-if="c" style="display:none"> (<i>char*</i>)</span></span>
</div>
<p class="pardesc">Name of the image to be read.</p>
<p class="pardesc"><span class="parcat">Default:
      </span>
    <span data-if="hdevelop" style="display:inline">'printer_chip/printer_chip_01'</span>
    <span data-if="c" style="display:none">"printer_chip/printer_chip_01"</span>
    <span data-if="cpp" style="display:none">"printer_chip/printer_chip_01"</span>
    <span data-if="com" style="display:none">"printer_chip/printer_chip_01"</span>
    <span data-if="dotnet" style="display:none">"printer_chip/printer_chip_01"</span>
    <span data-if="python" style="display:none">"printer_chip/printer_chip_01"</span>
</p>
<p class="pardesc"><span class="parcat">Suggested values:
      </span><span data-if="hdevelop" style="display:inline">'fabrik'</span><span data-if="c" style="display:none">"fabrik"</span><span data-if="cpp" style="display:none">"fabrik"</span><span data-if="com" style="display:none">"fabrik"</span><span data-if="dotnet" style="display:none">"fabrik"</span><span data-if="python" style="display:none">"fabrik"</span>, <span data-if="hdevelop" style="display:inline">'fuse'</span><span data-if="c" style="display:none">"fuse"</span><span data-if="cpp" style="display:none">"fuse"</span><span data-if="com" style="display:none">"fuse"</span><span data-if="dotnet" style="display:none">"fuse"</span><span data-if="python" style="display:none">"fuse"</span>, <span data-if="hdevelop" style="display:inline">'mreut'</span><span data-if="c" style="display:none">"mreut"</span><span data-if="cpp" style="display:none">"mreut"</span><span data-if="com" style="display:none">"mreut"</span><span data-if="dotnet" style="display:none">"mreut"</span><span data-if="python" style="display:none">"mreut"</span>, <span data-if="hdevelop" style="display:inline">'multiple_dies_01'</span><span data-if="c" style="display:none">"multiple_dies_01"</span><span data-if="cpp" style="display:none">"multiple_dies_01"</span><span data-if="com" style="display:none">"multiple_dies_01"</span><span data-if="dotnet" style="display:none">"multiple_dies_01"</span><span data-if="python" style="display:none">"multiple_dies_01"</span>, <span data-if="hdevelop" style="display:inline">'particle'</span><span data-if="c" style="display:none">"particle"</span><span data-if="cpp" style="display:none">"particle"</span><span data-if="com" style="display:none">"particle"</span><span data-if="dotnet" style="display:none">"particle"</span><span data-if="python" style="display:none">"particle"</span>, <span data-if="hdevelop" style="display:inline">'patras'</span><span data-if="c" style="display:none">"patras"</span><span data-if="cpp" style="display:none">"patras"</span><span data-if="com" style="display:none">"patras"</span><span data-if="dotnet" style="display:none">"patras"</span><span data-if="python" style="display:none">"patras"</span>, <span data-if="hdevelop" style="display:inline">'printer_chip/printer_chip_01'</span><span data-if="c" style="display:none">"printer_chip/printer_chip_01"</span><span data-if="cpp" style="display:none">"printer_chip/printer_chip_01"</span><span data-if="com" style="display:none">"printer_chip/printer_chip_01"</span><span data-if="dotnet" style="display:none">"printer_chip/printer_chip_01"</span><span data-if="python" style="display:none">"printer_chip/printer_chip_01"</span>, <span data-if="hdevelop" style="display:inline">'rings_and_nuts'</span><span data-if="c" style="display:none">"rings_and_nuts"</span><span data-if="cpp" style="display:none">"rings_and_nuts"</span><span data-if="com" style="display:none">"rings_and_nuts"</span><span data-if="dotnet" style="display:none">"rings_and_nuts"</span><span data-if="python" style="display:none">"rings_and_nuts"</span>, <span data-if="hdevelop" style="display:inline">'tooth_rim'</span><span data-if="c" style="display:none">"tooth_rim"</span><span data-if="cpp" style="display:none">"tooth_rim"</span><span data-if="com" style="display:none">"tooth_rim"</span><span data-if="dotnet" style="display:none">"tooth_rim"</span><span data-if="python" style="display:none">"tooth_rim"</span></p>
<p class="pardesc"><span class="parcat">File extension:
          </span>.<code>hobj</code>, .<code>ima</code>, .<code>tif</code>, .<code>tiff</code>, .<code>gif</code>, .<code>bmp</code>, .<code>jpg</code>, .<code>jpeg</code>, .<code>jp2</code>, .<code>jxr</code>, .<code>png</code>, .<code>pcx</code>, .<code>ras</code>, .<code>xwd</code>, .<code>pbm</code>, .<code>pnm</code>, .<code>pgm</code>, .<code>ppm</code></p>
</div>
<div data-if="hdevelop" style="display:inline">
<h2 id="sec_example_hdevelop">例程 (HDevelop)</h2>
<pre class="example">
* Reading an image:
  read_image(Image,'mreut')

* Reading 3 images into an image array:
  read_image(Images,['ic0','ic1','ic2'])

* Setting of search path for images on '/mnt/images' and '/home/images':
  set_system('image_dir','/mnt/images:/home/images')
</pre>
</div>
<div data-if="c" style="display:none">
<h2 id="sec_example_c">例程 (C)</h2>
<pre class="example">
/* Reading an image: */
  read_image(&amp;Image,"mreut");

/* Reading 3 images into an image array: */
  Htuple Files;
  create_tuple(&amp;Files,3);
  set_s(Files,"ic0",0);
  set_s(Files,"ic1",1);
  set_s(Files,"ic2",2);
  T_read_image(&amp;Images,Files);

/* Setting of search path for images on '/mnt/images' and '/home/images': */
  set_system("image_dir","/mnt/images:/home/images");
</pre>
</div>
<div data-if="cpp" style="display:none">
<h2 id="sec_example_cpp">例程 (HDevelop)</h2>
<pre class="example">
* Reading an image:
  read_image(Image,'mreut')

* Reading 3 images into an image array:
  read_image(Images,['ic0','ic1','ic2'])

* Setting of search path for images on '/mnt/images' and '/home/images':
  set_system('image_dir','/mnt/images:/home/images')
</pre>
</div>
<div data-if="com" style="display:none">
<h2 id="sec_example_com">例程 (HDevelop)</h2>
<pre class="example">
* Reading an image:
  read_image(Image,'mreut')

* Reading 3 images into an image array:
  read_image(Images,['ic0','ic1','ic2'])

* Setting of search path for images on '/mnt/images' and '/home/images':
  set_system('image_dir','/mnt/images:/home/images')
</pre>
</div>
<div data-if="dotnet" style="display:none">
<h2 id="sec_example_dotnet">例程 (HDevelop)</h2>
<pre class="example">
* Reading an image:
  read_image(Image,'mreut')

* Reading 3 images into an image array:
  read_image(Images,['ic0','ic1','ic2'])

* Setting of search path for images on '/mnt/images' and '/home/images':
  set_system('image_dir','/mnt/images:/home/images')
</pre>
</div>
<h2 id="sec_result">结果</h2>
<p>If the parameters are correct 该算子 <code><span data-if="hdevelop" style="display:inline">read_image</span><span data-if="c" style="display:none">read_image</span><span data-if="cpp" style="display:none">ReadImage</span><span data-if="com" style="display:none">ReadImage</span><span data-if="dotnet" style="display:none">ReadImage</span><span data-if="python" style="display:none">read_image</span></code>
返回值 <TT>2</TT> (
      <TT>H_MSG_TRUE</TT>)
    .  Otherwise an exception is raised.</p>
<h2 id="sec_successors">可能的后置算子</h2>
<p>
<code><a href="disp_image.html"><span data-if="hdevelop" style="display:inline">disp_image</span><span data-if="c" style="display:none">disp_image</span><span data-if="cpp" style="display:none">DispImage</span><span data-if="com" style="display:none">DispImage</span><span data-if="dotnet" style="display:none">DispImage</span><span data-if="python" style="display:none">disp_image</span></a></code>, 
<code><a href="threshold.html"><span data-if="hdevelop" style="display:inline">threshold</span><span data-if="c" style="display:none">threshold</span><span data-if="cpp" style="display:none">Threshold</span><span data-if="com" style="display:none">Threshold</span><span data-if="dotnet" style="display:none">Threshold</span><span data-if="python" style="display:none">threshold</span></a></code>, 
<code><a href="regiongrowing.html"><span data-if="hdevelop" style="display:inline">regiongrowing</span><span data-if="c" style="display:none">regiongrowing</span><span data-if="cpp" style="display:none">Regiongrowing</span><span data-if="com" style="display:none">Regiongrowing</span><span data-if="dotnet" style="display:none">Regiongrowing</span><span data-if="python" style="display:none">regiongrowing</span></a></code>, 
<code><a href="count_channels.html"><span data-if="hdevelop" style="display:inline">count_channels</span><span data-if="c" style="display:none">count_channels</span><span data-if="cpp" style="display:none">CountChannels</span><span data-if="com" style="display:none">CountChannels</span><span data-if="dotnet" style="display:none">CountChannels</span><span data-if="python" style="display:none">count_channels</span></a></code>, 
<code><a href="decompose3.html"><span data-if="hdevelop" style="display:inline">decompose3</span><span data-if="c" style="display:none">decompose3</span><span data-if="cpp" style="display:none">Decompose3</span><span data-if="com" style="display:none">Decompose3</span><span data-if="dotnet" style="display:none">Decompose3</span><span data-if="python" style="display:none">decompose3</span></a></code>, 
<code><a href="class_ndim_norm.html"><span data-if="hdevelop" style="display:inline">class_ndim_norm</span><span data-if="c" style="display:none">class_ndim_norm</span><span data-if="cpp" style="display:none">ClassNdimNorm</span><span data-if="com" style="display:none">ClassNdimNorm</span><span data-if="dotnet" style="display:none">ClassNdimNorm</span><span data-if="python" style="display:none">class_ndim_norm</span></a></code>, 
<code><a href="gauss_filter.html"><span data-if="hdevelop" style="display:inline">gauss_filter</span><span data-if="c" style="display:none">gauss_filter</span><span data-if="cpp" style="display:none">GaussFilter</span><span data-if="com" style="display:none">GaussFilter</span><span data-if="dotnet" style="display:none">GaussFilter</span><span data-if="python" style="display:none">gauss_filter</span></a></code>, 
<code><a href="fill_interlace.html"><span data-if="hdevelop" style="display:inline">fill_interlace</span><span data-if="c" style="display:none">fill_interlace</span><span data-if="cpp" style="display:none">FillInterlace</span><span data-if="com" style="display:none">FillInterlace</span><span data-if="dotnet" style="display:none">FillInterlace</span><span data-if="python" style="display:none">fill_interlace</span></a></code>, 
<code><a href="zoom_image_size.html"><span data-if="hdevelop" style="display:inline">zoom_image_size</span><span data-if="c" style="display:none">zoom_image_size</span><span data-if="cpp" style="display:none">ZoomImageSize</span><span data-if="com" style="display:none">ZoomImageSize</span><span data-if="dotnet" style="display:none">ZoomImageSize</span><span data-if="python" style="display:none">zoom_image_size</span></a></code>, 
<code><a href="zoom_image_factor.html"><span data-if="hdevelop" style="display:inline">zoom_image_factor</span><span data-if="c" style="display:none">zoom_image_factor</span><span data-if="cpp" style="display:none">ZoomImageFactor</span><span data-if="com" style="display:none">ZoomImageFactor</span><span data-if="dotnet" style="display:none">ZoomImageFactor</span><span data-if="python" style="display:none">zoom_image_factor</span></a></code>, 
<code><a href="crop_part.html"><span data-if="hdevelop" style="display:inline">crop_part</span><span data-if="c" style="display:none">crop_part</span><span data-if="cpp" style="display:none">CropPart</span><span data-if="com" style="display:none">CropPart</span><span data-if="dotnet" style="display:none">CropPart</span><span data-if="python" style="display:none">crop_part</span></a></code>, 
<code><a href="write_image.html"><span data-if="hdevelop" style="display:inline">write_image</span><span data-if="c" style="display:none">write_image</span><span data-if="cpp" style="display:none">WriteImage</span><span data-if="com" style="display:none">WriteImage</span><span data-if="dotnet" style="display:none">WriteImage</span><span data-if="python" style="display:none">write_image</span></a></code>, 
<code><a href="rgb1_to_gray.html"><span data-if="hdevelop" style="display:inline">rgb1_to_gray</span><span data-if="c" style="display:none">rgb1_to_gray</span><span data-if="cpp" style="display:none">Rgb1ToGray</span><span data-if="com" style="display:none">Rgb1ToGray</span><span data-if="dotnet" style="display:none">Rgb1ToGray</span><span data-if="python" style="display:none">rgb1_to_gray</span></a></code>
</p>
<h2 id="sec_alternatives">可替代算子</h2>
<p>
<code><a href="read_sequence.html"><span data-if="hdevelop" style="display:inline">read_sequence</span><span data-if="c" style="display:none">read_sequence</span><span data-if="cpp" style="display:none">ReadSequence</span><span data-if="com" style="display:none">ReadSequence</span><span data-if="dotnet" style="display:none">ReadSequence</span><span data-if="python" style="display:none">read_sequence</span></a></code>
</p>
<h2 id="sec_see">参考其它</h2>
<p>
<code><a href="set_system.html"><span data-if="hdevelop" style="display:inline">set_system</span><span data-if="c" style="display:none">set_system</span><span data-if="cpp" style="display:none">SetSystem</span><span data-if="com" style="display:none">SetSystem</span><span data-if="dotnet" style="display:none">SetSystem</span><span data-if="python" style="display:none">set_system</span></a></code>, 
<code><a href="write_image.html"><span data-if="hdevelop" style="display:inline">write_image</span><span data-if="c" style="display:none">write_image</span><span data-if="cpp" style="display:none">WriteImage</span><span data-if="com" style="display:none">WriteImage</span><span data-if="dotnet" style="display:none">WriteImage</span><span data-if="python" style="display:none">write_image</span></a></code>
</p>
<h2 id="sec_module">模块</h2>
<p>
Foundation</p>
<!--OP_REF_FOOTER_START-->
<hr>
<div class="indexlink">
<a href="index_classes.html"><span data-if="dotnet" style="display:none;">类别</span><span data-if="cpp" style="display:none;">类别</span></a><span data-if="dotnet" style="display:none;"> | </span><span data-if="cpp" style="display:none;"> | </span><a href="index_by_name.html">算子列表</a>
</div>
<div class="footer">
<div class="copyright">HALCON算子参考手册 Copyright © 2015-2023 51Halcon</div>
</div>
</div>
</body>
</html>
